﻿using System;
using System.Web;
using _5E.Utils.WebHelper;
using _5E.Utils.WebHelper.Route;

namespace Pool.WebSite.Service.CodeBehind
{
    public class Global : HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            AjaxHandler.Manager = new PoolRouteManager();
            AsyncResult.OnError = ex => GetInnerException(ex).Message;
        }

        private Exception GetInnerException(Exception ex)
        {
            return null == ex.InnerException ? ex : GetInnerException(ex.InnerException);
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}
